//
//  CAICameraOverlayView.h
//  CAIImagePickerControllerKit
//
//  Created by 海参 on 2022/8/2.
//
//  简介：作为UIImagePickerController自定义相机控件的简单视图。
//  缺点：CAMPreviewViewController拍摄捕捉区域的坐标系原点是从屏幕顶部开始的，大小是根据屏幕适配动态高度500（这个得和系统原生保持一致）；
//  如果用户希望拍摄区域位置和自定义相机固有的拍摄大小位置不同，就无法满足；底部预留区域UI适配布局无法兼容，需要做特殊处理；

#import <UIKit/UIKit.h>
#import "CAIPhotoBrowser.h"
#import "CAICameraPhotoInfoModel.h"

NS_ASSUME_NONNULL_BEGIN

@class CAICameraOverlayView;
@protocol CAICameraOverlayViewDelegate <NSObject>

///取消
- (void)cameraOverlayViewDidCancel:(CAICameraOverlayView *)view;


///拍照
- (void)cameraOverlayViewDidTake:(CAICameraOverlayView *)view;


///确定选择
//- (void)cameraOverlayView:(CAICameraOverlayView *)view
//      didFinishPickingImages:(NSArray <UIImage *>*)images;

///确定选择
- (void)cameraOverlayView:(CAICameraOverlayView *)view
   didFinishPickingImages:(NSArray <UIImage *>*)images
              imageModels:(NSArray <CAIUIImagePickerCameraPhotoModel *>*)models;


///拍照超过数量不允许
- (void)cameraOverlayViewDidTakeLimitNumberNotAllow:(CAICameraOverlayView *)view;

@end


@interface CAICameraOverlayView : UIView<CAIPhotoBrowserDelegate>

@property (nonatomic, weak) id <CAICameraOverlayViewDelegate>delegate;

/// 主题色
@property (nonatomic, strong) UIColor *commonTintColor;

/// 拍照后刷新UI
- (void)reloadUIWithTakePicture:(nullable CAICameraPhotoInfoModel *)photoModel;


/// 最多item数量，到达这个数，就不能再加入
@property (nonatomic, assign) NSInteger maxItemCount;

/// 最大限制数
@property (nonatomic, assign) NSInteger limitCount;

/// 获取图片
@property (nonatomic, readonly) NSArray *photoArray;

@end

NS_ASSUME_NONNULL_END
